#pragma once
#include "Hazel/Core/Base.h"

#include "Hazel/Core/window.h"
#include "Hazel/Core/LayerStack.h"
#include "Hazel/Core/Timestep.h"

#include "Hazel/Events/Event.h"
#include "Hazel/Events/ApplicationEvent.h"

#include "Hazel/ImGui/ImGuiLayer.h"


namespace Hazel
{
	

	class HAZEL_API Application
	{
	public:
		Application();
		virtual ~Application();

		void Run();

		void OnEvent(Event& e);

		void Close();

		void PushLayer(Layer* layer);
		void PushOverLayer(Layer* overlayer);

		inline static Application& Get() { return *s_Instance; }
		inline Window& GetWindow() { return *m_Window; }
	private:
		bool OnWindowClose(WindowCloseEvent& e);
		bool OnWindowResize(WindowResizeEvent& e);

		std::unique_ptr<Window> m_Window;
		ImGuiLayer* m_ImGuiLayer;
		bool m_Running = true;
		bool m_Minimized = false;

		LayerStack m_LayerStack;

		Timestep m_Timestep = 0;
		float m_LastFrameTime = 0.0f;
	private:
		static Application* s_Instance;
	};

	// To be define in client
	Application* CreateApplication();
}


